<template>
  <div class="workspace">
    <div class="anbox">
      <button @click="assemble">合成</button>
      <button @click="disassemble">拆解</button>
    </div>
  </div>
</template>

<script>
import { threes } from '@/utils/threeseen.js'

export default {
  name: 'WorkspaceJsonSeen',

  mixins: [threes],

  mounted() {
    this.init()
    this.animate()
  },

  data() {
    return {}
  },

  methods: {
    assemble() {
      this.combination()
      // this.resumeAction()
    },

    disassemble() {
      // 如果已经拆解，直接返回

      // 调用播放动画的方法，假设动画名称为 'All Animations'
      // this.playAction('All Animations')
      this.splitting()
    }
  }
}
</script>

<style scoped>
.workspace {
  height: 100%;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

#three-container {
  width: 1000px;
  height: 800px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: red;
  overflow: hidden;
  z-index: 1;
}
.anbox {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>
